Conditions | 1 |
Paths | 1 |
Total Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | export default { |
||
26 | changeVisibility (visible) { |
||
27 | this.toggleVisiblity(); |
||
28 | |||
29 | let updateAction = this.getAction(); |
||
30 | |||
31 | this.ajax.patch(updateAction, { |
||
32 | visible: this.visible, |
||
33 | }) |
||
34 | .then(function () { |
||
35 | let title = 'Project Hidden'; |
||
36 | let message = this.project.name + ' is not publicly viewable'; |
||
37 | |||
38 | if (this.visible) { |
||
39 | title = 'Project Visible'; |
||
40 | message = this.project.name + ' is now publicly viewable'; |
||
41 | } |
||
42 | |||
43 | this.flash({ |
||
44 | title: title, |
||
45 | message: message, |
||
46 | type: 'success' |
||
47 | }); |
||
48 | }) |
||
49 | .catch(function () { |
||
50 | this.flash({ |
||
51 | title: 'Error', |
||
52 | message: 'Could not change project visibility', |
||
53 | type: 'error' |
||
54 | }); |
||
55 | }); |
||
56 | }, |
||
57 | |||
71 | }; |